package com.bsj.power.common.def.entity.locationDevice;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bsj.power.common.constant.NumericalConstants;
import com.bsj.power.common.def.vo.pls.httpVo.HttpTagInfoVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author LiJiaXin
 * @version 1.0.0
 * @description LocationDevice
 * @time 2024/4/19 11:24
 */
@Data
@TableName(value = "tab_location_device")
@NoArgsConstructor
@AllArgsConstructor
public class LocationDevice {

    /**
     * 定位设备id
     */
    @TableId(value = "device_id", type = IdType.AUTO)
    private Long deviceId;

    /**
     * 设备号
     */
    @TableField("device_name")
    private String deviceName;

    /**
     * 设备别名
     */
    @TableField("nike_name")
    private String nikeName;

    /**
     * 系统同步过来的外来名字（设备编码）
     */
    @TableField("other_name")
    private String otherName;

    /**
     * 生产厂商
     */
    @TableField("manufacturer")
    private String manufacturer;

    /**
     * 设备类型 1基站 2UWB 3UWB+北斗
     */
    @TableField("device_type")
    private Integer deviceType;

    /**
     * 设备型号
     */
    @TableField("device_model")
    private String deviceModel;

    /**
     * 固件版本
     */
    @TableField("firmware")
    private String firmware;

    /**
     * 激活时间
     */
    @TableField("activation_time")
    private Date activationTime;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;

    /**
     * 树id
     */
    @TableField("tree_id")
    private Integer treeId;

    /**
     * 佩戴类型 1手表 2WIFI电话 3标签
     */
    @TableField("wear_type")
    private Integer wearType;

    /**
     * 二维位置点
     */
    @TableField("point_json2d")
    private String pointJson2d;

    /**
     * 楼层（1是-9.5米，2是0米，3是7.5米，4是16米）
     */
    @TableField("floor")
    private Integer floor;

    /**
     * 栋数（0是外围，1是1栋，2是2栋）
     */
    @TableField("building")
    private Integer building;

    /**
     * 是否锁定  UWB或UWB+北斗使用  1是 2否
     */
    @TableField("is_lock_in")
    private Integer isLockIn;

    /**
     * 在平台已手动绑卡仍然扫脸弹卡的人员姓名
     */
    @TableField(exist = false)
    private String personName;

    public LocationDevice(HttpTagInfoVO httpTagInfoVO, Integer type, Integer wearType) {
        this.deviceName = httpTagInfoVO.getSn();
        this.otherName = httpTagInfoVO.getName();
        this.deviceType = type;
        this.deviceModel = httpTagInfoVO.getProductKey();
        this.firmware = httpTagInfoVO.getVersion();
        this.wearType = wearType;
    }
}
